package com.woniu.darryringmall.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 获取系统当前时间
 *
 * @author yangxiguang
 */
public class MallUtils {

    public static String getNow() {
        DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return sdf.format(LocalDateTime.now());
    }

    public static String getNumber() {
        DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        return sdf.format(LocalDateTime.now());
    }

    public static String getOrderNo() {
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        return "WN" + fmt.format(now) + (int) (Math.random() * 9000 + 1000);
    }

}